<template>
  <vxe-modal
    title="查看记录"
    v-model="dialogVisible"
    v-if="dialogVisible"
    :loading="loading"
    width="60%" showFooter esc-closable show-zoom resize>

    <div style="height: 69vh; overflow-y: auto;">
      <el-card class="box-card" shadow="never" :body-style="{ padding: '10px',backgroundColor: '#bfcdda' }">
        <!-- 基本信息 -->
        <el-card class="box-card" shadow="hover">
          <div slot="header" class="clearfix">
            <span style="font-size: 16px; color: #1890ff;">基本信息</span>
          </div>
          <el-descriptions class="margin-top" :column="2" size="medium" border
                           :contentStyle="content_style" :labelStyle="label_style">
            <el-descriptions-item>
              <template slot="label">
                <div class="right-align-label">
                  <i class="el-icon-user"></i>
                  六号线采购计划编号：
                </div>
              </template>
              {{ lhxcgjhData.lhxcgjhId }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                <div class="right-align-label">
                  <i class="el-icon-user"></i>
                  创建时间：
                </div>
              </template>
              {{ lhxcgjhData.createTime }}
            </el-descriptions-item>
          </el-descriptions>
        </el-card>
        <br>
        <!-- 需求计划明细信息 -->
        <el-card class="box-card" shadow="hover">
          <div slot="header" class="clearfix">
            <span style="font-size: 16px; color: #1890ff">需求计划明细信息</span>
          </div>
          <el-table height="33vh" :header-cell-style="{background:'#d0cece',color:'#000000',fontWeight:'bold'}"
                    :data="lhxcgjhMxList">
            <el-table-column label="序号" align="center" type="index" width="50"/>
            <el-table-column align="center" label="物资名称" prop="wzMc"/>
            <el-table-column align="center" label="规格及型号" prop="ggJXh"/>
            <el-table-column align="center" label="技术、工艺要求等" prop="jsGyYq"/>
            <el-table-column align="center" label="数量" prop="sl"/>
            <el-table-column align="center" label="单位" prop="dw"/>
            <el-table-column align="center" label="预算单价(元)" prop="ysDj"/>
            <el-table-column align="center" label="预算复价" prop="ysFj"/>
            <el-table-column align="center" label="购置原因" prop="gzYy"/>
            <el-table-column align="center" label="此类设备在本单位拥有及使用情况" prop="yyJSyQk"/>
            <el-table-column align="center" label="使用时间" prop="sySj"/>
            <el-table-column align="center" label="用途说明" prop="ytSm"/>
            <el-table-column align="center" label="备注" prop="bz"/>
          </el-table>
        </el-card>
        <br>

      </el-card>
    </div>

    <div slot="footer" class="dialog-footer dialog-footer-center">
      <el-button @click="dialogVisible=false">关闭</el-button>
    </div>
  </vxe-modal>
</template>
<script>

import {getLhxcgjh} from "@/api/xqjh/lhxcgjh";

export default {
  name: "LhxCgJhXq", //六号线采购计划详情组件
  data() {
    return {
      // 六号线采购计划明细表格数据
      lhxcgjhMxList: [],
      loading: false,
      lhxcgjhData: [], //六号线采购计划基本信息
      lhxcgjhId: null, //六号线采购计划主键ID
      dialogVisible: false,
      content_style: {
        // 解决不对齐的问题
        'width': "400px",
        // 排列第二行
        'word-break': 'break-all',
        // 'background-color': '#f3f7ff'
      },
      label_style: {
        // 解决不对齐的问题
        'width': "250px",
        // 排列第二行
        'word-break': 'break-all',
      },
    };
  },
  created() {
  },
  methods: {
    handleOpen(row) {
      this.loading = true;
      this.lhxcgjhId = row.lhxcgjhId
      this.dialogVisible = true
      this.getLhxcgjhData()
      setTimeout(() => {
        this.loading = false
      }, 1000)
    },
    //获取详情数据
    getLhxcgjhData() {
      const lhxcgjhId = this.lhxcgjhId
      getLhxcgjh(lhxcgjhId).then(res => {
        this.lhxcgjhData = res.data
        this.lhxcgjhMxList = res.data.lhxcgjhMxList;
      })
    },


  }
};
</script>

<style scoped>
.right-align-label {
  text-align: right;
}
</style>
